<html>
<head><meta charset="utf-8"><title>guessing game example · wg-async-foundations/book · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/201246-wg-async-foundations/book/index.html">wg-async-foundations/book</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/201246-wg-async-foundations/book/topic/guessing.20game.20example.html">guessing game example</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="168967877"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/201246-wg-async-foundations/book/topic/guessing%20game%20example/near/168967877" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/201246-wg-async-foundations/book/topic/guessing.20game.20example.html#168967877">(Jun 25 2019 at 19:13)</a>:</h4>
<p>So <span class="user-mention" data-user-id="211722">@Yoshua Wuyts</span> I am having a few unanticipated concerns arise as I try to move my "guessing game" edits into proper testable snippets. Here are a few of them:</p>
<ul>
<li>the existing example uses <code>stream.split()</code> -- actually, this seems probably ok, as we can basically explain what it does and give a "forward ref" to the streams chapter where you will explain it</li>
<li>runtime release is currently something like 0.3.0-alpha4, I guess that's...ok. 1.0 would be better. Do you think we'd be considering a 1.0 at any point?</li>
<li>right now the example uses <code>failure::Error</code>, but I was hoping to avoid referencing <code>failure</code>. Annoyingly, you can't actually use <code>Box&lt;dyn Error + Send&gt;</code> because (dear god) there is no <code>From</code> impls for doing the conversion from <code>std::io::Error</code> (those exist only for <code>Box&lt;dyn Error&gt;</code>, <span aria-label="cry" class="emoji emoji-1f622" role="img" title="cry">:cry:</span> )</li>
</ul>



<a name="168969904"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/201246-wg-async-foundations/book/topic/guessing%20game%20example/near/168969904" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/201246-wg-async-foundations/book/topic/guessing.20game.20example.html#168969904">(Jun 25 2019 at 19:37)</a>:</h4>
<blockquote>
<p>hoping to avoid referencing failure</p>
</blockquote>
<p>Shameless self-promotion, but SNAFU has built-in futures 0.1 and 0.3 support :-)</p>
<p>I’m sure that you just want to avoid using any crates, though.</p>



<a name="168970742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/201246-wg-async-foundations/book/topic/guessing%20game%20example/near/168970742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/201246-wg-async-foundations/book/topic/guessing.20game.20example.html#168970742">(Jun 25 2019 at 19:48)</a>:</h4>
<p>I've not really looked at SNAFU, I must admit</p>



<a name="169052361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/201246-wg-async-foundations/book/topic/guessing%20game%20example/near/169052361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nemo157 <a href="https://rust-lang.github.io/zulip_archive/stream/201246-wg-async-foundations/book/topic/guessing.20game.20example.html#169052361">(Jun 26 2019 at 17:35)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> you can use <code>Box&lt;dyn Error + Send + Sync&gt;</code></p>



<a name="169069769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/201246-wg-async-foundations/book/topic/guessing%20game%20example/near/169069769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/201246-wg-async-foundations/book/topic/guessing.20game.20example.html#169069769">(Jun 26 2019 at 19:01)</a>:</h4>
<p>I’d appreciate an aside about “we are doing convenient error handling to focus on async and not advocating any particular style” (so long as that’s true). People tend to copy-paste and then treat as gospel such examples.</p>



<a name="169072916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/201246-wg-async-foundations/book/topic/guessing%20game%20example/near/169072916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/201246-wg-async-foundations/book/topic/guessing.20game.20example.html#169072916">(Jun 26 2019 at 19:37)</a>:</h4>
<p>I think the sad truth is I wouldn't know what error handling style to recommend</p>



<a name="169096008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/201246-wg-async-foundations/book/topic/guessing%20game%20example/near/169096008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/201246-wg-async-foundations/book/topic/guessing.20game.20example.html#169096008">(Jun 27 2019 at 01:25)</a>:</h4>
<blockquote>
<p>Do you think we'd be considering a 1.0 [runtime release] at any point?</p>
</blockquote>
<p>@nikomatsakis Yeah definitely, though I think the first milestone is to get us off alpha.x releases. Which kind of depends on futures-rs moving off there too.</p>



<a name="169238022"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/201246-wg-async-foundations/book/topic/guessing%20game%20example/near/169238022" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/201246-wg-async-foundations/book/topic/guessing.20game.20example.html#169238022">(Jun 28 2019 at 16:08)</a>:</h4>
<p>K</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>